#!/bin/bash
echo -e "\033[32m正在安装NFS......\033[0m"  
yum -y install nfs-utils rpcbind
ssh root@192.168.93.152 'yum -y install nfs-utils rpcbind'  # 手动输入密码或配置免密
ssh root@192.168.93.153 'yum -y install nfs-utils rpcbind'  # 手动输入密码或配置免密
echo -e "\033[32m正在创建所需目录......\033[0m"  
mkdir -p /data/volumes
cat >> /etc/exports << EOF
/data/volumes 192.168.93.0/24(rw,no_root_squash)
EOF
chmod -R 777 /data/
systemctl enable nfs rpcbind --now
echo -e "\033[32m安装完毕请执行以下命令......\033[0m"
echo -e "\033[32mshowmount -e IP地址......\033[0m"

